<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery-3.6.0.js"></script>
</head>
<button>点我</button>
<button class='aa'>点击我</button>

<body>

    <button onclick="fun()">点击</button>
    <button onclick="fun()">点击</button>
    <button onclick="fun()">点击</button>
    <button onclick="fun()">点击</button>
    <button onclick="fun()">点击</button>
    <script>
        function fun() {
            console.log(event.currentTarget);
            console.log(event.srcElement);
        }
    </script>
</body>

</html>
<script>
    var button = document.querySelector("button");
    button.addEventListener("click", ff);
    var aa = document.querySelector(".aa");
    aa.onclick = function () {
        button.removeEventListener("click", ff);//移出点击事件
    }
    function ff() {
        alert("aa");
    }
</script>